package com.xtaller.test.config.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @version V1.0
 * @author: Taller
 * @date: 2019-08-09
 * @Description:
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Resource public TokenInter token;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(token).addPathPatterns("/v*/**");
//        registry.addInterceptor(token).addPathPatterns("/app/v*/**");
//        registry.addInterceptor(token).addPathPatterns("/pc/v*/**");
//        registry.addInterceptor(token).addPathPatterns("/xxx/v*/**");
    }
}
